# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=gitg
pkgver=41
pkgrel=3
epoch=2
pkgdesc="GNOME GUI client to view git repositories"
url="https://wiki.gnome.org/Apps/Gitg"
arch=(x86_64)
license=(GPL)
depends=(
  cairo
  dconf
  gcc-libs
  gdk-pixbuf2
  glibc
  glib2
  gobject-introspection-runtime
  gsettings-desktop-schemas
  gspell
  gtk3
  gtksourceview4
  hicolor-icon-theme
  json-glib
  libdazzle
  libgee
  libgirepository
  libgit2-glib
  libpeas
  libsecret
  libxml2
  pango
  python-gobject
)
makedepends=(
  git
  gobject-introspection
  meson
  vala
)
groups=(gnome-extra)
_commit=1adffb6b3ce97626f2ed23885d6d0e44a2764cbe  # tags/v41^0
source=("git+https://gitlab.gnome.org/GNOME/gitg.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd gitg
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd gitg

  # remove illegal positional argument to i18n.merge_file()
  git cherry-pick -n 1978973b12848741b08695ec2020bac98584d636
}

build() {
  arch-meson gitg build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"

  python -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
}

# vim:set sw=2 sts=-1 et:
